#ifndef __SDIO_SDCARD_H
#define __SDIO_SDCARD_H		

#include "common.h" 

//////////////////////////////////////////////////////////////////////////////////	 

			  
//SDIO_CK=SDIOCLK/[clkdiv+2];  SDIOCLK 48Mhz
#define SDIO_INIT_CLK        0x76 	    //SDIO initialization frequency, maximum 400Kh 
#define SDIO_TRANSFER_CLK    0x00		//SDIO transmission frequency


#define SD_WORK_MODE  0     // 0: query mode 1: DMA mode
		  

typedef struct
{
  SD_CSD SD_csd;
  SD_CID SD_cid;
  long long CardCapacity;    	//SD card capacity  
  u32 CardBlockSize; 		    //SD card block size
  u16 Rlative_ADD;				//Card relative address
  u8 CardType;				    //Card type
} SD_CardInfo;	

extern SD_CardInfo SDCardInfo;  	 



//SD card initialization
SD_Error SD_Init(void);



u8 SD_ReadSDisk(u8*buf,u32 sector,u8 cnt); 	
u8 SD_WriteSDisk(u8*buf,u32 sector,u8 cnt);	

#endif 




